<%
var title="系统错误日志";
layout("/layouts/blank.html",{title:title}){
%>
<section class="content-header">
    <h1>
        ${title}
        <small>控制面板</small>
    </h1>
</section>
<section class="content">
    <div style="background: #ffffff">
        <div id="errorLogTable" lay-filter='errorLogTable'></div>
    </div>
</section>
<script type="text/html" id="toolBarFixed">
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="view">查看错误日志</a>
</script>
<script type="text/javascript">
    new Vue({
        data: {},
        methods: {
            layuiInit:function () {
                layui.use('table', function () {
                    var table = layui.table; //表格
                    errorLogTable = table.render({
                        id: 'errorLogTable',
                        elem: '#errorLogTable',
                        page: true,
                        method: 'post',
                        url: base + "/sysLogs/errorLogListData",
                        limit: 50,
                        even: true,
                        height: 720,
                        request: {
                            pageName: 'pageNum',
                            limitName: 'pageSize',
                        },
                        where: {
                        },
                        cols: [[
                            {title: '序号', type: 'numbers', align:'center',width: 100},
                            {field: 'userDesc', title: '用户名', align:'center'},
                            {field: 'ct', title: '错误日志时间', align:'center'},
                            {field: 'path', title: '错误路径', align:'center'},
                            {title: '操作', align: 'center',  fixed: 'right', toolbar: '#toolBarFixed'},
                        ]]
                    });
                    table.on("tool(errorLogTable)", function (obj) {
                        var data = obj.data, layEvent = obj.event;
                        var ac = layEvent;
                        if (ac == "view") {
                            layer.open({
                                type: 1,
                                title: ['错误日志'],
                                shade: 0.3,
                                area: ['80%', '80%'],
                                content: "<pre style='padding: 5px;height: 100%;border: 0px;overflow: scroll'>" + data.errorMsgInfo + "</pre>",
                            });
                        }
                    });
                });
            },
        },
        created: function () {
            this.layuiInit();
        },
        updated: function () {
            this.layuiInit();
        },
        mounted: function () {
            this.layuiInit();
        }
    });
    /*
    beforeCreate（创建前）,
    created（创建后）,
    beforeMount(载入前),
    mounted（载入后）,
    beforeUpdate（更新前）,
    updated（更新后）,
    beforeDestroy（销毁前）,
    destroyed（销毁后）
    */
</script>
<%}%>